package RUN;

import java.util.Random;

public class Tor implements Runnable{
	public void run() {
		for(int i=2;i<=20;) {
			System.out.println("乌龟跑了"+i+"米");
			i=i+2;
			try {
				Thread.sleep(1000);
				int r;
				Random random=new Random();
				r=random.nextInt(2);
				r=r+1;
				System.out.println("乌龟休息了"+r+"秒");
			}catch(InterruptedException e) {}
			if(i>20) {
				System.out.println("乌龟到终点了！");
			}
		}
	}
}